import rxAjax from '@/assets/js/ajax.js';

//接口项目表 api接口
export const SysInterfaceProjectApi = {};

SysInterfaceProjectApi.baseUrl= '/api-system/system/core/sysInterfaceProject';
SysInterfaceProjectApi.exportUrl= SysInterfaceProjectApi.baseUrl + '/listExport';

//查询列表
SysInterfaceProjectApi.query=function (parameter) {
  var url= SysInterfaceProjectApi.baseUrl + '/query';
  return rxAjax.postJson(url,parameter).then (res => {
    return res.result
  })
}

/**
* 获取单记录
* @param pkId
* @returns {*}
*/
SysInterfaceProjectApi.get =function(pkId) {
  var url= SysInterfaceProjectApi.baseUrl + '/get?pkId=' + pkId;
  return rxAjax.get(url);
}

//保存数据
SysInterfaceProjectApi.save =function(parameter) {
  var url= SysInterfaceProjectApi.baseUrl + '/save';
  return rxAjax.postJson(url,parameter);
}

//删除数据
SysInterfaceProjectApi.del =function(parameter) {
  var url= SysInterfaceProjectApi.baseUrl + '/del';
  return rxAjax.postUrl(url,parameter);
}

SysInterfaceProjectApi.update =function(parameter) {
    var url= SysInterfaceProjectApi.baseUrl + '/update';
    return rxAjax.postJson(url,parameter);
}

SysInterfaceProjectApi.updExport =function(ids) {
    var url= SysInterfaceProjectApi.baseUrl + '/updExport';
    return rxAjax.postForm(url,{ids:ids});
}
//变更分类
SysInterfaceProjectApi.changeCategory=function(ids,categoryId){
    var url= SysInterfaceProjectApi.baseUrl+'/changeCategory';
    return rxAjax.postForm(url, {ids:ids,categoryId:categoryId});
}

export  default SysInterfaceProjectApi;

